#import <appkit/appkit.h>
#import "AShape.h"
#define DEFAULTFILL NO
#define DEFAULTSHADE 0.0
#define NOBBYSIZE 6.0

void massageRect(r)
NXRect *r;
{
    if(r->size.width<0){
    	r->size.width = fabs(r->size.width);
	r->origin.x -= r->size.width;
    }
    if(r->size.height<0){
    	r->size.height = fabs(r->size.height);
	r->origin.y -= r->size.height;
    }
	return;
}

@implementation AShape

-initShapeWithBBox:(NXRect *)r;
{
    [super init];
    bbox = *r;
    fill = DEFAULTFILL;
    shade = DEFAULTSHADE;
    return self;
}

-setFill:(int)i
{
       fill = i;
	return self;
}
 
-(int)fill {return fill;}

-setShade:(float)s
{
	shade = s;
	return self;
}

-(float)shade{return shade;}

-setBbox:(NXRect *)r
{
	bbox = *r;
	massageRect(&bbox);
	return self;
}

-(NXRect *)bbox {return &bbox;}

-drawShape
{
	return self;
}

@end